import React from 'react'
// ===================================================================== Temp
import Table from '#cpt/temp/Table'
// ===================================================================== Declare
const { $fn } = window
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
		// 项目状态
		auditStatus: [{ name:'待审核', value:'0' },{ name:'审核通过', value:'1' },{ name:'待录入', value:'-2' }],
		
	}
	
	model = {}
	
	// paging
	fetch = (param) => {
		if(param){
			this.box_number = param.box_number
		} 
		$fn.fetch.call(this,'specimen/boxlists', { param: {box_num: this.box_number, audit_status:1} })
	}
	
	// 关联表单
	cols = [
		{ title: '标本箱号',		dataIndex: 'box_num', 		...$fn.table.exp_num, },
		{ title: '医院名称',		dataIndex: 'hosp_name', 	width:150,				sorter:true },
		{ title: '条码号',		dataIndex: 'spec_code', 	...$fn.table.exp_num,	sorter:true },
		{ title: '标本数量',		dataIndex: 'spec_num', 		width:100 },
		{ title: '送检时间',		dataIndex: 'arrival_time', 	...$fn.table.time },
		{ title: '项目状态',		dataIndex: 'audit_status', 	width:100,	render: text => $fn.getState(this.state.auditStatus,text) },
	]

	render(){
		return ( Table.call(this, {sort:true,} ) )
	}
}

export default Index